package com.shenmazong.serverdubboconsumer.controller;

import com.shenmazong.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class UserController {
    @Reference(version = "${user.service.version}", interfaceClass = UserService.class)
    private UserService userService;

    @GetMapping(value = "/hi")
    public String sayHi() {
        String msg = userService.sayHello();
        System.out.println(msg);
        return msg;
    }

}
